package com.yaorange.medical.mapper;

import com.yaorange.medical.domain.BsBreathHistory;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
* @author Administrator
* @description 针对表【bs_breath_history(呼吸机历史数据表)】的数据库操作Mapper
* @createDate 2024-06-07 10:12:15
* @Entity com.yaorange.medical.domain.BsBreathHistory
*/
public interface BsBreathHistoryMapper{

    /**
     * 查询最后一条呼吸机历史数据（但是要排除当前请求的历史数据，因此应该取第二条）
     * @param deviceId
     * @return
     */
    @Select("select * from bs_breath_history where device_id = #{deviceId} order by request_time desc limit 1,1")
    BsBreathHistory selectLastByDeviceId(@Param("deviceId") String deviceId);
}




